package com.qd.common.sys.domain.entity.station;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 岗位职责
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
@ToString
public class StationSetDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "岗位职责";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "职责标识"})
    @NotBlank(message = "职责标识不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "职责标识长度不能超过{max}位", groups = DefaultGroup.class)
    private String stationId;
    /**
     * 职责代码
     */
    @ExcelProperty(value = {EXCEL_TITLE, "*职责代码"})
    @NotBlank(message = "职责代码不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "职责代码长度不能超过{max}位", groups = DefaultGroup.class)
    private String stationCode;
    /**
     * 职责名称
     */
    @ExcelProperty(value = {EXCEL_TITLE, "*职责名称"})
    @NotBlank(message = "职责名称不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "职责名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String stationName;
    /**
     * 是否名称
     */
    @ExcelProperty(value = {EXCEL_TITLE, "*是否启用"})
    private String enableDisplay;
    /**
     * 排序
     */
    @ExcelProperty(value = {EXCEL_TITLE, "排序"})
    @NotNull(message = "排序不能为空", groups = DefaultGroup.class)
    private Integer idx;
    /**
     * 添加时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "添加时间"})
    private LocalDateTime addTime;
    /**
     * 更新时间
     */
    @ExcelProperty(value = {EXCEL_TITLE, "更新时间"})
    private LocalDateTime updateTime;
    /**
     * 是否启用
     */
    @NotNull(message = "是否启用不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "是否启用长度不能超过{max}位", groups = DefaultGroup.class)
    @ExcelIgnore
    private String enable;

    @Override
    public void freeData() {
        this.stationId = null;
        this.stationCode = null;
        this.stationName = null;
        this.idx = null;
        this.addTime = null;
        this.updateTime = null;
        this.enable = null;
        this.enableDisplay = null;
        super.freeData();
    }
}
